package com.yphone.net.bean.base;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.yphone.cjencrypt.EncryptUtils;
import com.yphone.tools.MyLog;

public class BaseDataResult {
    @SerializedName(alternate = {"code"}, value = "Code")
    public Integer Code;
    @SerializedName(alternate = {"data"}, value = "Data")
    public String Data;
    @SerializedName(alternate = {"msg"}, value = "Msg")
    public String Msg;
    @SerializedName(alternate = {"success"}, value = "Success")
    public String Success;

    public void setData() {
        if (TextUtils.isEmpty(this.Data)) {
            this.Data = "{}}";
            return;
        }
        try {
            this.Data = EncryptUtils.decode(this.Data);
        } catch (Exception e) {
            this.Data = "{}";
        }
    }

    public String getJson() {
        String s = new Gson().toJson(this);
        MyLog.e("getJson result = "+s);
        return s;
    }
}